package com.nine.dao;

import java.util.List;

import com.nine.entity.Permission;
import com.nine.entity.Roles;

public interface RolesMapper {
	
	/**
	 * 获取所有角色信息
	 * @return	角色实体集合
	 */
	public List<Roles> getAllRoles();
	
	/**
	 * 根据角色id获取该角色所拥有的权限
	 * @param id	角色id
	 * @return		权限集合
	 */
	public List<Permission> getPermissionsByRoleId(Integer id);
	
	/**
	 * 根据角色id获取该角色所未拥有的权限
	 * @param id	角色id
	 * @return		权限集合
	 */
	public List<Permission> getUnpermissionsByRoleId(Integer id);
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table roles
     *
     * @mbggenerated Fri Sep 14 11:26:37 CST 2018
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table roles
     *
     * @mbggenerated Fri Sep 14 11:26:37 CST 2018
     */
    int insert(Roles record);

    /**
     * 选择性的添加角色信息
     * @param record	实体
     * @return	影响的行数
     */
    int insertSelective(Roles record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table roles
     *
     * @mbggenerated Fri Sep 14 11:26:37 CST 2018
     */
    Roles selectByPrimaryKey(Integer id);

    /**
     * 	根据主键有选择性的修改用户信息
     * @param record 实体集合
     * @return	影响行数
     */
    int updateByPrimaryKeySelective(Roles record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table roles
     *
     * @mbggenerated Fri Sep 14 11:26:37 CST 2018
     */
    int updateByPrimaryKey(Roles record);
    
    /**
	 * 多项删除用户
	 * @param ids	主键数组
	 * @return		影响行数
	 */
	public int delMoreiRoles(Integer[] ids);
}